/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
 * Microsystems, Inc. All Rights Reserved.
 */


package org.medbeans.modules.search;


import org.openide.nodes.Node;
import org.openide.TopManager;
import org.openide.util.actions.CallableSystemAction;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;


/**
 * Action which searchs on filesystems.
 *
 * @author  Petr Kuzel
 */
public class RepositorySearchAction extends CallableSystemAction {

    public static final long serialVersionUID = 1;

    /** Creates new RepositorySearchAction */
    public RepositorySearchAction() {        
    }

    protected String iconResource() {
        return "/org/netbeans/modules/search/res/find.gif"; // NOI18N
    }
    
    /** @return human readable name of action */
    public String getName() {
        return NbBundle.getBundle(RepositorySearchAction.class).getString("TEXT_ACTION_REPOSITORY_SEARCH");
    }

    public HelpCtx getHelpCtx() {
        return new HelpCtx (RepositorySearchAction.class);
    }

    /** Where to search */
    public Node[] getNodes() {
        return new Node[] {TopManager.getDefault().getPlaces().nodes().repository()};
    }

    /** Perform this action. */
    public void performAction() {
        SearchPerformer.getDefault().performAction(this);
    }

}
